package com.ieheima.demo;

import java.io.FileReader;
import java.io.IOException;
import java.nio.charset.Charset;

public class CharClass01 {
    public static void main(String[] args) throws IOException {
        /*FileReader fr = new FileReader("F:\\study\\就业班\\练习txt\\aa.txt");
        int a;
        while ((a = fr.read()) != -1) {
            System.out.println((char) a);
        }
        fr.close();*/

        /*InputStreamReader isr = new InputStreamReader(new FileInputStream("F:\\study\\就业班\\练习txt\\aa.txt"),"GBK");
        int a;
        while ((a = isr.read()) != -1) {
            System.out.print((char) a);
        }
        isr.close();*/
        FileReader fr = new FileReader("F:\\study\\就业班\\练习txt\\aa.txt", Charset.forName("GBK"));
        int a;
        while ((a = fr.read()) != -1) {
            System.out.print((char) a);
        }
        fr.close();
    }
}
